package com.group.www.service.impl;

import com.group.www.dao.impl.CartInfoDao;
import com.group.www.interfaces.ICartInfo_q;
import com.group.www.pojo.CartInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@com.alibaba.dubbo.config.annotation.Service
@Service
public class CartInfoServiceImp implements ICartInfo_q{
    @Autowired
    private CartInfoDao dao;
    @Override
    public List<CartInfo> queryCartInfoByuserid(Integer userId) {
        return dao.queryCartInfoByuserid(userId);
    }

    @Override
    public boolean add(CartInfo cartInfo) {
        return dao.add(cartInfo);
    }

    @Override
    public boolean update(Integer userId, Integer goodsId, Integer goodsNums) {
        return dao.update(userId,goodsId,goodsNums);
    }

    @Override
    public boolean deleteCartInfoby(Integer userId, Integer goodsId) {
        return dao.deleteCartInfoby(userId,goodsId);
    }
    /********/
    @Override
    public boolean add(Object entity) {
        return false;
    }

    @Override
    public boolean update(Object entity) {
        CartInfo cartInfo=(CartInfo)entity;
        return dao.updateCart(cartInfo);
    }

    @Override
    public List query() {
        return dao.query();
    }

    @Override
    public boolean delete(Object entity) {
        return false;
    }

}
